package com.facebook.common.internal;

import javax.annotation.Nullable;

public final class ToStringHelper {
    final class ValueHolder {
        String a;
        Object b;
        ValueHolder c;

        ValueHolder(byte arg1) {
            this();
        }

        private ValueHolder() {

        }
    }

    private final String a;
    private ValueHolder b;
    private ValueHolder c;

    private ToStringHelper(String arg3) {

        this.b = new ValueHolder((byte) 0);
        this.c = this.b;
        this.a = Preconditions.checkNotNull(arg3);
    }

    public ToStringHelper(String arg1, byte arg2) {
        this(arg1);
    }

    public final ToStringHelper add(String arg3, @Nullable Object arg4) {
        ValueHolder v1 = new ValueHolder((byte) 0);
        this.c.c = v1;
        this.c = v1;
        v1.b = arg4;
        v1.a = Preconditions.checkNotNull(arg3);
        return this;
    }

    public final ToStringHelper add(String arg2, boolean arg3) {
        return this.add(arg2, String.valueOf(arg3));
    }

    public final String toString() {
        String v1 = "";
        StringBuilder v2 = new StringBuilder(32).append(this.a).append('{');
        ValueHolder v0;
        for (v0 = this.b.c; v0 != null; v0 = v0.c) {
            v2.append(v1);
            v1 = ", ";
            if (v0.a != null) {
                v2.append(v0.a).append('=');
            }
            v2.append(v0.b);
        }
        return v2.append('}').toString();
    }
}

